package org.pp.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.pp.entity.Role;
import org.pp.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author haima
 * @since 2024-02-20
 */
@RestController
@RequestMapping("/role")
@Tag(name = "角色相关")
public class RoleController {

    @Autowired
    IRoleService roleService;
    @GetMapping("/add")
    @Operation(summary = "添加角色")
    public String add(){
        Role r= new Role();
        r.setName("超级管理员");
        roleService.save(r);
        return "ok";
    }
}
